package com.xiaoKe.zhonghzu.ui.login;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.xiaoKe.zhonghzu.R;
import com.xiaoKe.zhonghzu.global.tool.SPUtils;

/**
 * @ProjectName : A3
 * @Author : Shijingna
 * @Time : 2024/8/27 17:00
 * @Description : 启动页
 */
public class SplashActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        // 初始化一些数据或者等待后台加载完成
        Thread splashTread = new Thread() {
            @Override
            public void run() {
                try {
                    int waited = 0;
                    while (waited < 3000) { // 3000 milliseconds
                        sleep(100);
                        waited += 100;
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                } finally {
                    // 移除焦点避免闪烁
                    SplashActivity.this.finish();
                    // 跳转到主活动

                }
            }
        };
        splashTread.start();
    }
}
